package cn.wd.common.util;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author wangdong
 * @date 2024/9/12 16:46
 **/
public class CollUtils {

    public static <T> boolean isEmpty(List<T> list) {
        return list == null || list.isEmpty();
    }

    public static <T> boolean isNotEmpty(List<T> list) {
        return !isEmpty(list);
    }

    public static <T> Set<T> convertToSet(T... args) {
        Set<T> set = new HashSet<>();
        if (args == null || args.length <= 0) {
            return set;
        }
        for (T arg : args) {
            if (arg instanceof String) {
                String str = String.valueOf(arg);
                if (StrUtils.isBlank(str)) {
                    continue;
                }
            }
            set.add(arg);
        }
        return set;
    }
}
